import java.util.Scanner;

/**
 * @Author 12629
 * @Description：
 */
public class Test2 {


    public boolean isPalindrome(String s) {
        s = s.toLowerCase();
        int i = 0;
        int j = s.length()-1;
        while(i < j) {
            while(i < j && !isNumOrCharacter(s.charAt(i)) ) {
                i++;
            }
            while(i < j && !isNumOrCharacter(s.charAt(j)) ) {
                j--;
            }
            if(s.charAt(i) == s.charAt(j)) {
                i++;
                j--;
            }else {
                return false;
            }
        }
        return true;
    }

    private boolean isNumOrCharacter(char ch) {
        if(ch >= '0' && ch <= '9' || ch >= 'a' && ch <= 'z') {
            return true;
        }
        return false;
    }


    public static void main2222(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            String str = in.nextLine();
            String[] ret = str.split(" ");
            System.out.println(ret[ret.length-1].length());
        }
    }

    public static void main33333(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            String str = in.nextLine();
            int index = str.lastIndexOf(" ");
            String tmp = str.substring(index+1);
            System.out.println(tmp.length());
        }
    }

    public int firstUniqChar(String s) {
        if(s == null) return -1;
        int[] count = new int[26];
        for(int i = 0;i < s.length();i++) {
            char ch = s.charAt(i);
            count[ch-'a']++;
        }
        for(int i = 0;i < s.length();i++) {
            char ch = s.charAt(i);
            if(count[ch-'a'] == 1) {
                return i;
            }
        }
        return -1;
    }

    public static void main(String[] args) {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(1);
        stringBuilder.append("hello");
        stringBuilder.append(12.5);

        System.out.println(stringBuilder);

        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append("abcdef");
        //stringBuffer.insert(3,"abcdef");
        System.out.println(stringBuffer.reverse());


        //1. 字符串转 StringBuilder
        String str = "abcd";
        //StringBuilder stringBuilder1 = new StringBuilder(str);
       /* StringBuilder stringBuilder1 = new StringBuilder();
        stringBuilder1.append(str);*/

        //2. StringBuilder 转换 字符串
        StringBuilder stringBuilder2 = new StringBuilder();
        stringBuilder2.append("defr");
        String str2 = stringBuilder2.toString();
        System.out.println(str2);

    }

    public static void main3(String[] args) {
        long start = System.currentTimeMillis();
        String s = "";
        for(int i = 0; i < 10000; ++i){
            s += i;
        }
        long end = System.currentTimeMillis();
        System.out.println(end - start);

        start = System.currentTimeMillis();
        StringBuffer sbf = new StringBuffer("");
        for(int i = 0; i < 10000; ++i){
            sbf.append(i);
        }
        end = System.currentTimeMillis();
        System.out.println(end - start);


        start = System.currentTimeMillis();
        StringBuilder sbd = new StringBuilder();
        for(int i = 0; i < 10000; ++i){
            sbd.append(i);
        }
        end = System.currentTimeMillis();
        System.out.println(end - start);

    }

    public static void main2(String[] args) {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("hello");
        stringBuilder.append(" world");
        String ret = stringBuilder.toString();
        System.out.println(ret);

    }
    public static void main1(String[] args) {
        String s = "hello";
        s += " world";//s = s + " world"
        System.out.println(s);
    }
}
